<script setup>
import { queryCategoryAll } from "@/api/category";
import { ref,onMounted } from "vue";

const getCategory  = async ()=>{
  const result = await queryCategoryAll()
  data.value = result.data
}

onMounted(()=>{
  getCategory()
})
const data = ref([])

</script>

<template> 
<div><h3>商品分类管理</h3></div>
  <el-table
    :data="data"
    style="width: 100%; margin-bottom: 20px"
    row-key="id"
    border
    default-expand-all>
    <el-table-column prop="name" label="商品类别" sortable/>
    <el-table-column prop="createBy" label="创建人" sortable align="center"/>
    <el-table-column prop="createTime" label="创建时间" sortable align="center"/>
    <el-table-column label="操作" align="center">
      <template #default="scope">
        <el-button type="primary" size="small" plain><el-icon><EditPen /></el-icon></el-button>
        <el-button type="danger" size="small" plain><el-icon><Delete /></el-icon></el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<style scoped>
</style>